﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////

// Reviewed
#pragma once

#include "GcmpModelInterface.h"
#include "IEvent.h"

namespace gcmp
{
    class IDrawingViewport;
    class IDrawingViewportEventHandler;

    /// \brief 图纸视口事件接口类
    ///
    /// 文档元素数据变化（增、删和改）时，发送事元素改变事件
    class GCMP_MODEL_INTERFACE_EXPORT IDrawingViewportEvent : public IEvent
    {
        DEFINE_CAST_DERIVED(gcmp::IDrawingViewportEvent, gcmp::IEvent)

    public:
        /// \brief 添加事件处理者 
        /// \param pHandler 事件处理者
        /// \return 返回true表示添加成功，否则表示失败
        virtual bool Add(IDrawingViewportEventHandler* pHandler) = 0;

        /// \brief 删除事件处理者，仅从容器中删除
        /// \param pHandler 事件处理者
        /// \return 返回true表示删除成功，否则表示失败
        virtual bool Delete(IDrawingViewportEventHandler* pHandler) = 0;

        /// \brief 得到事件发送者
        /// \return 事件发送者
        virtual IDrawingViewport* GetSender() const = 0;
    };
}
